Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to expose stacking claim bug #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

whoabuddy
Copy link
Contributor

This PR adds a test to expose a stacking claim bug identified in Discord, where a user can claim their CityCoins back from the contract before the STX are distributed by the pool operator.

Adding the pinned message content from Discord as well:


STACKING CONTRACT BUG

There is a bug in the stacking contract (CCD007), such that if you claim your rewards before the cycle is paid by the pool operator, and have CityCoins that are eligible to return, then you will receive only the CityCoins and not the STX reward.

If you did not have CityCoins that were eligible for return, the bug would not have affected you, and the transaction would fail until the cycle is paid by the pool operator.

The good news is that the bug does not affect the math used to determine the cycle rewards, so for those who experienced it, we can create a CCIP to retroactively pay the STX rewards from the contract. This would come from the stacking treasury and does not affect the mining treasury that was stacked.

In the short term, we can mitigate this by having minecitycoins.com or any other front-end that allows user claims to check if the cycle is paid by the pool operator before allowing the user to claim. This would be a temporary fix until the bug is fixed in the contract, and can be done through the is-cycle-paid read-only function.

The long term fix for this would be to create a v2 of the stacking contract, as well as explore some simpler migration options then having everyone unstack and stack again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant